package com.gz.springboot.controller;

import com.gz.springboot.exception.AccessException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class ErrorController {

    @GetMapping("/err")
    public String error() {
        int i=10/0;   //登录后有session后这一步出现500错误被exception捕获
        return "manage";
    }

    @GetMapping("/err2")
    public String myerror(String name) {
        if(!name.equals("Tom")) {
            throw new AccessException();
        }
        return "manage";
    }
}
